<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}


?>
<div class="pageHeader">
	<p><b>菜品发布 > 编辑套餐</b></p>
</div>
<div class="pageContent" >
<form method="post" action="index.php?mod=caipu&act=addedipackage" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
<input type="hidden" name="sub" value="save" />
<input type="hidden" name="id" value="<?=$id?>" />
<div class="pageFormContent nowrap" layoutH="80" style="overFlow-x: hidden;">



<dl>
    <dt>选择名厨(名店)：</dt>
    <dd>
    
    <span class="info" style=""><?=select($cheflist,$row['shop_id'],'shop_id','')?>&nbsp;必选</span>
    </dd>
    </dl>
    <dl>
    <dt>套餐名称：</dt>
    <dd>
    <input type="text" name="title" style="width:300px" id="title"  value="<?=$row["title"]?>" class="required" />
        <span class="info">&nbsp;</span>
    </dd>
    </dl>

    <dl>
    <dt>适合人数：</dt>
    <dd>
    <input type="text" name="rens" style="width:300px"  id="rens" value="<?=$row["rens"]?>" class="required" />
        <span class="info">&nbsp;</span>
    </dd>
    </dl>
 



    <dl>
    <dt>套餐总价：</dt>
    <dd>
    <input type="text" name="totalprice" style="width:300px"  value="<?=$row["totalprice"]?>"  />
        <span class="info">&nbsp;</span>
    </dd>
    </dl>    

    <dl>
    <dt>预订费用：</dt>
    <dd>
    <input type="text" name="marketprice" style="width:300px"  value="<?=$row["marketprice"]?>"  />
        <span class="info">&nbsp;</span>
    </dd>
    </dl>    
           
    <dl>
    <dt>是否上架：</dt>
    <dd>
<?=html_radio($yesno_arr,$row["status"],"status")?>

    <span class="info">&nbsp;</span>
    </dd>
    </dl>  
                
    <dl>
    <dt>产品缩略图：</dt>
    <dd>

       <input name="imgs0.id" id="imgs0_id" type="hidden" value="">
        <input name="imgs0.fileName" class="readonly textInput" id="imgs0_fileName" style="width: 300px;" type="text" readonly="readonly" value="<?=$row["thumb"]?>">
        <a title="" class="btnPic" href="index.php?mod=content&amp;act=upload" width="460" height="200" lookupgroup="imgs0">附件</a>
        <input name="imgs0.title" class="textInput" id="imgs0_title" type="text" value="" style="display: none;">
       <span class="info">&nbsp; &nbsp;<img style="cursor: pointer;" onclick="javascript:clearimginfo('imgs0_')" src="images/cross.png"> 默认缩略图</span>


    </dd>
    </dl>
               
<?
/*
$i=0;

while($i<10){
    if(isset($dishes["title"][$i])){
        $title1=$dishes["title"][$i];
        $id1=$dishes["id"][$i];
        $num1=$dishes["num"][$i];
        
    }else{
        $num1="";
        $title1="";
        $id1="";
    }
    $i++;
?>    
<dl>
    <dt>菜品<?=$i?>：</dt>
    <dd>
    <input name="met<?=$i?>.id" value="<?=$id1?>" id="linkcats" type="hidden"><input type="text" placeholder="选择菜品" name="met<?=$i?>.orgName" style="width:100px"  value="<?=$title1?>" class="lookup" />
      <?if(!empty($row['shop_id'])&&$row['shop_id']>0){?>  
    <a class="btnLook" href="index.php?mod=caipu&sid=<?=$row['shop_id']?>&act=linklist&v=" lookupGroup="met<?=$i?>">选择</a>
    <?}else{?>
    <a class="btnLook" href="index.php?mod=caipu&act=linklist&v=" lookupGroup="met<?=$i?>">选择</a>
     <?}?>   
        <span style="float: left;">&nbsp;数量：</span><input type="text" name="met<?=$i?>.orgNum"  style="width:100px" placeholder="" value="<?=$num1?>"  />
        <span class="info">&nbsp;</span>
    </dd>
    </dl>
    
<?
    
}
*/
?>

    
                

    <dl>
    <dt>简介：</dt>
    <dd>
    <textarea name="description" id="description" class="span7" style="height: 100px;" cols="70"><?=$row["description"]?></textarea>
        <span class="info">&nbsp;</span>
    </dd>
    </dl>
    <dl>
    <dt>选择菜品：</dt>
    <dd>      
     <?
     while(list($k,$v)=each($cailist)){
     ?>
     <input type="checkbox" value="<?=$v["id"]?>" name="goods[]" <? if(in_array($v["id"],$dishesidlist)){ echo "checked";} ?> /> <?=$v["title"]?><br />  
     
     
     <? 
     }
     ?>
      
    </dd>
    </dl>        

<dl>
<dt>排序：</dt>
<dd>
<input type="text" name="listorder" style="width:100px"  value="<?=$row["displayorder"]?>"  />
 <span class="info">&nbsp;越大越靠前</span>
</dd>
    </dl>

</div>
<div class="formBar">
<ul style="float:left;">
<li><div class="buttonActive"><div class="buttonContent"><button type="submit">发 布 菜 品</button></div></div></li>
</ul>
</div>
</form>

<script type="text/javascript">
function clearimginfo(divid){
    $("#"+divid+"title").val("");
    $("#"+divid+"id").val("");
    $("#"+divid+"fileName").val("");
    
}
document.getElementById('shop_id').onchange=function(){
    $('.btnLook').attr('href','index.php?mod=caipu&act=linklist&sid='+$('#shop_id').val()+'&v=');
}
</script>